<!DOCTYPE HTML>
<html 
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui"
    xmlns:components="http://java.sun.com/jsf/composite/components">
    <f:view  contentType="text/html">
        
        <f:metadata>
            <f:viewParam name="id" value="#{itemViewBean.currentObject}" converter="#{itemConverter}"/>
        </f:metadata>
        
        <h:head>
            <meta charset="utf-8" />
            <meta name="description" content="#{msgs['msg.general.desc']}"/> 
            <title><h:outputText value="#{msgs['msg.general.title']}"/></title>

            <link rel="stylesheet" type="text/css" href="#{request.contextPath}/css/style.css"/>
            <link rel="stylesheet" type="text/css" href="#{request.contextPath}/css/view.css"/>

            <h:outputScript library="javax.faces" name="jsf.js"/>
            <h:outputScript library="primefaces" name="jquery/jquery.js" target="head" />
            <script type="text/javascript" src="#{request.contextPath}/js/script.js"></script>  
        </h:head>

        <h:body onclick="window.close();">
            <h:panelGroup layout="block" styleClass="body-content">
                <section id="main-content">

                    <h2><h:outputText value="#{itemViewBean.currentObject.title}"/></h2>
                    <table id="top">
                        <tr>    
                            <td class='picture'>
                                <h:graphicImage url="/img/no-photo.jpg" />
                            </td>
                            <td class='description'><h:outputText value="#{itemViewBean.currentObject.description}"/></td>            
                        </tr>
                    </table>
                    
                    <table id="about">
                        <tr>
                            <td class='info'><h:outputText value="#{msgs['itemViewPage.price']}"/></td>
                            <td>
                                <h:outputText value="#{itemViewBean.currentObject.price}" >
                                    <f:convertNumber type="currency" groupingUsed="true" minFractionDigits="2"
                                                     currencySymbol="#{msgs['itemListPage.itemstable.price.currencySymbol']}" />
                                </h:outputText>
                            </td>
                        </tr>
                        <tr>
                            <td class='info'><h:outputText value="#{msgs['itemViewPage.addedDate']}"/></td>
                            <td>
                                <h:outputText value="#{itemViewBean.currentObject.addedDate}" >
                                    <f:convertDateTime pattern="#{msgs['itemListPage.itemstable.info.about.date.pattern']}"/>
                                </h:outputText>
                            </td>
                        </tr>
                        <tr>
                            <td class='info'><h:outputText value="#{msgs['itemViewPage.category']}"/></td>
                            <td><h:outputText value="#{itemViewBean.currentObject.category.name}" /></td>
                        </tr>
                        <tr>
                            <td class='info'><h:outputText value="#{msgs['itemViewPage.region']}"/></td>
                            <td><h:outputText value="#{itemViewBean.currentObject.region.name}" /></td>
                        </tr>
                        <tr>
                            <td class='info'><h:outputText value="#{msgs['itemViewPage.codepostal']}"/></td>
                            <td><h:outputText value="#{itemViewBean.currentObject.postalCode}" /></td>
                        </tr>
                        <tr>
                            <td class='info'><h:outputText value="#{msgs['itemViewPage.nom']}"/></td>
                            <td><h:outputText value="#{itemViewBean.currentObject.name}" /></td>
                        </tr>
                        <tr>
                            <td class='info'><h:outputText value="#{msgs['itemViewPage.phone']}"/></td>
                            <td><h:outputText value="#{itemViewBean.currentObject.phone}" /></td>
                        </tr>
                        <tr>
                            <td class='info'><h:outputText value="#{msgs['itemViewPage.email']}"/></td>
                            <td><h:outputText value="#{itemViewBean.currentObject.email}" /></td>
                        </tr>
                    </table>

                </section>

                <ui:insert name="footer">
                    <ui:include src="../../templates/footer.xhtml" />
                </ui:insert> 
            </h:panelGroup>	
            <ui:debug hotkey="d" />		
        </h:body>

    </f:view>
</html>